package com.example.tests;


public class ContactData implements Comparable<ContactData> {
	
		private String id;
		private String firstname;
        private String lastname;
        private String address1;
        private String home1;
        private String mobile1;
        private String work1;
        private String email;
        private String email2;
        private String bday;
        private String bmonth;
        private String byear;
        private String group;
        private String address2;
        private String home2;
        
        
        public void setId(String id) {
			this.id = id;
		}

		public void setFirstname(String firstname) {
			this.firstname = firstname;
		}

		public void setLastname(String lastname) {
			this.lastname = lastname;
		}

		public void setAddress1(String address1) {
			this.address1 = address1;
		}

		public void setHome1(String home1) {
			this.home1 = home1;
		}

		public void setMobile1(String mobile1) {
			this.mobile1 = mobile1;
		}

		public void setWork1(String work1) {
			this.work1 = work1;
		}

		public void setEmail(String email) {
			this.email = email;
		}

		public void setEmail2(String email2) {
			this.email2 = email2;
		}

		public void setBday(String bday) {
			this.bday = bday;
		}

		public void setBmonth(String bmonth) {
			this.bmonth = bmonth;
		}

		public void setByear(String byear) {
			this.byear = byear;
		}

		public void setGroup(String group) {
			this.group = group;
		}

		public void setAddress2(String address2) {
			this.address2 = address2;
		}

		public void setHome2(String home2) {
			this.home2 = home2;
		}

		

        public ContactData() {
        }
        
        public ContactData(String firstname, String lastname, String address1,
                        String home1, String mobile1, String work1, String email,
                        String email2, String bday, String bmonth,  String byear, String group1, String address2, String home2) {
                this.firstname = firstname;
                this.lastname = lastname;
                this.address1 = address1;
                this.home1 = home1;
                this.mobile1 = mobile1;
                this.work1 = work1;
                this.email = email;
                this.email2 = email2;
                this.bday = bday;
                this.bmonth = bmonth;
                this.byear = byear;
                this.group = group1;
                this.address2 = address2;
                this.home2 = home2;
                
        }
        
        public String getId() {
			return id;
		}
	
        public String getFirstname() {
                return firstname;
        }


        public String getLastname() {
                return lastname;
        }


        public String getAddress1() {
                return address1;
        }


        public String getHome1() {
                return home1;
        }


        public String getMobile1() {
                return mobile1;
        }


        public String getWork1() {
                return work1;
        }


        public String getEmail() {
                return email;
        }


        public String getEmail2() {
                return email2;
        }


        public String getBday() {
                return bday;
        }


        public String getBmonth() {
                return bmonth;
        }


        public String getByear() {
                return byear;
        }


        public String getGroup() {
                return group;
        }


        public String getAddress2() {
                return address2;
        }


        public String getHome2() {
                return home2;
        }


        @Override
        public String toString() {
                return "ContactData [lastname=" + lastname + "]";
        }


        @Override
        public int hashCode() {
                //final int prime = 31;
                int result = 1;
                //result = prime * result + ((name == null) ? 0 : name.hashCode());
                return result;
        }


        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                ContactData other = (ContactData) obj;
                if (lastname == null) {
                        if (other.lastname != null)
                                return false;
                } else if (!lastname.equals(other.lastname))
                        return false;
                return true;
        }


        @Override
        public int compareTo(ContactData other) {
                return this.lastname.toLowerCase().compareTo(other.lastname.toLowerCase());
        }

        public ContactData withId(String id) {
            this.id = id;
            return this;
    }

        
        public ContactData withFirstname(String firstname) {
                this.firstname = firstname;
                return this;
        }


        public ContactData withLastname(String lastname) {
                this.lastname = lastname;
                return this;
        }


        public ContactData withAddress1(String address1) {
                this.address1 = address1;
                return this;
        }


        public ContactData withHome1(String home1) {
                this.home1 = home1;
                return this;
        }


        public ContactData withMobile1(String mobile1) {
                this.mobile1 = mobile1;
                return this;
        }


        public ContactData withWork1(String work1) {
                this.work1 = work1;
                return this;
        }


        public ContactData withEmail1(String email1) {
                email = email1;
                return this;
        }


        public ContactData withEmail2(String email2) {
                this.email2 = email2;
                return this;
        }


        public ContactData withBday(String bday) {
                this.bday = bday;
                return this;
        }


        public ContactData withBmonth(String bmonth) {
                this.bmonth = bmonth;
                return this;
        }


        public ContactData withByear(String byear) {
                this.byear = byear;
                return this;
        }


        public ContactData withAddress2(String address2) {
                this.address2 = address2;
                return this;
        }


        public ContactData withHome2(String home2) {
                this.home2 = home2;
                return this;
        }
}